<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>

  <style>
    .box {
      width: 500px;
      height: 500px;
      margin: 0 auto;
      background-color: green;
      /*开启flex布局*/
      display: flex;
      /*justify-content决定了flex item在main axis上的对齐方式*/
      /*flex-start: 默认值, 与main start对齐*/
      /*flex-end: 与main end对齐*/
      /*center: 居中对齐*/
      /*space-between: flex item之间的距离相等, 与main start、main end两端对齐*/
      /*space-evenly: flex item之间的距离相等, flex item与main start、main end之间的距离等于flex item之间的距离*/
      /*space-around: flex item之间的距离相等, flex item与main start、main end之间的距离等于flex item之间的距离的一半*/
      justify-content: space-around;
    }

    .item {
      width: 100px;
      height: 100px;
      color: #fff;
      text-align: center;
      line-height: 100px;
    }

    .item1 {
      background-color: #f00;
    }

    .item2 {
      background-color: #0f0;
    }

    .item3 {
      background-color: #00f;
    }
  </style>
</head>
<body>
  <div class="box">
    <div class="item item1">item1</div>
    <div class="item item2">item2</div>
    <div class="item item3">item3</div>
  </div>
</body>
</html>